package jrain.iot.server.mqtt.business;

import jrain.fw.core.business.Business;
import jrain.fw.core.business.BusinessMethod;
import jrain.fw.core.business.BusinessRequest;
import jrain.fw.core.business.BusinessResponse;
import jrain.fw.core.log.Logger;
import jrain.fw.core.log.LoggerFactory;
import jrain.iot.server.mqtt.consts.MqttConst;
import jrain.utils.lang.StringUtils;

@Business(name="MqttSimpleUserService")
public class MqttSimpleUserService {
	
	private static Logger logger = LoggerFactory.getLogger(MqttSimpleUserService.class);
	@BusinessMethod()
	public BusinessResponse auth(BusinessRequest request){
		BusinessResponse response = new BusinessResponse();
		String userName = StringUtils.trimNull(request.getData(MqttConst.USER_NAME));
		String password = StringUtils.trimNull(request.getData(MqttConst.PASSWORD));
		logger.info(request,"conn,userName={},password={}",userName,password);
		return response;
	}
}
